<?php

/**
 * Ubicacion filter form base class.
 *
 * @package    KrazyTaxi
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseUbicacionFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'IDCALLE'         => new sfWidgetFormPropelChoice(array('model' => 'Calle', 'add_empty' => true)),
      'X'               => new sfWidgetFormFilterInput(),
      'Y'               => new sfWidgetFormFilterInput(),
      'NUMERODIRECCION' => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'IDCALLE'         => new sfValidatorPropelChoice(array('required' => false, 'model' => 'Calle', 'column' => 'IDCALLE')),
      'X'               => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'Y'               => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'NUMERODIRECCION' => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('ubicacion_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Ubicacion';
  }

  public function getFields()
  {
    return array(
      'IDUBICACION'     => 'Number',
      'IDCALLE'         => 'ForeignKey',
      'X'               => 'Number',
      'Y'               => 'Number',
      'NUMERODIRECCION' => 'Text',
    );
  }
}
